module ProductsHelper

	def type_image
		if @type.name == 'Produto'
			image_tag 'produtos/linha.gif', :class => 'textoLinha'
		else
			image_tag 'suprimento/suprimento.gif', :class => 'textoLinha'
		end
	end
	
	def link_to_label( label, html_class )    
		url_params = { :label_id => label.id, :action => 'index' }
		if @category
			url_params[:category_id] = @category.id
		end
		if @type
			url_params[:type_id] = @type.id
		end
		link_to( "Linha #{label.name}", url_params, :class => html_class)
	end
	
	def link_to_category( category )
		url_params = { :category_id => category.id, :action => 'index' }
		if @label
			url_params[:label_id] = @label.id
		end
		if @type
			url_params[:type_id] = @type.id
		end
		link_to( category.name, url_params, :style => 'color:white;' )
	end
	
end
